package com.yj.web.help;

import java.time.LocalDateTime;

/**
 * Created by yanlinyang on 2017/8/3.
 */
public class IdGenerater {
    public static String generateId(String machineNum) {
        StringBuilder id = new StringBuilder();
        String s = LocalDateTime.now().toString().replace("-","").replace("T","").replace(":","").replace(".","");
        String s1 = s.substring(0,s.length()-3);
        String s2 = s.substring(s.length()-3);
        String num = String.valueOf(System.nanoTime());
        num = num.substring(num.length()-3);
        id.append(s1).append(machineNum).append(s2).append(num);
        return id.toString();
    }
}
